package com.doordu.soa.service.data.service.impl;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.doordu.soa.service.data.dao.LogSyncErrorMapper;
import com.doordu.soa.service.data.entity.LogSyncError;
import com.doordu.soa.service.data.service.LogSyncErrorService;
import com.doordu.soa.service.data.vo.LogSyncErrorVo;
/**
 * 同步错误日志服务[实现类]
 * @ClassName: LogSyncErrorServiceImpl
 * @Description: 
 * @author xiaoqun.yi yixq@doordu.com  
 * @date 2017年9月14日 下午1:48:10
 * @version V1.0
 */
@Service
public class LogSyncErrorServiceImpl implements LogSyncErrorService {

	@Autowired
	private LogSyncErrorMapper logSyncErrorMapper;
	
	@Override
	public LogSyncErrorVo insertLogSyncError(Long logId, String errorJsondata, String errorReason, Short errorType) {
		LogSyncError entity=new LogSyncError();
		entity.setErrorJsondata(errorJsondata);
		entity.setLogId(logId);
		entity.setErrorType(errorType);
		entity.setErrorReason(errorReason);
		logSyncErrorMapper.insertSelective(entity);
		LogSyncErrorVo vo=new LogSyncErrorVo();
		BeanUtils.copyProperties(entity, vo);
		return vo;
	}

}
